#!/usr/bin/perl
#deletenv.cgi	Delete a net volume1

require './folderman-lib.pl';
&ReadParse();
#&header("delete", "index", 0, 1);
@abc = get_netvol_info($in{'volname'});

@dd=vol_mount_status($abc[1]);
my $volname = $abc[0];
my $path = "/netvol/".$volname;
my $src = $abc[1];

#print $volname;
#print $path;
#print $src;

#check Mount Status;
@mstat = vol_mount_status($src);
#print "|".$mstat[0];
if($mstat[0]){
	`umount $path 2>/dev/null`;	
}
&del_netvoltab($volname);
#&footer("index.cgi", "home");
&redirect("index.cgi");
